package com.sqfw.common.enums.knowledge;

import lombok.Getter;

/** 操作类型(知识类型) A-新增 M-修改 D-删除 C-核实 */
public enum KlContentOpeTypeEnum {

    A("A", "新增"),
    M("M", "修改"),
    D("D", "删除"),
    C("C", "核实"),
    ;

    @Getter
    private String key;
    @Getter
    private String desc;

    KlContentOpeTypeEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    /**
     * 根据key，查询描述
     * */
    public static KlContentOpeTypeEnum by(String key) {
        KlContentOpeTypeEnum[] enums = KlContentOpeTypeEnum.values();
        for (int i = 0; i < enums.length; i++) {
            if (key.equals(enums[i].key) ) {
                return enums[i];
            }
        }
        return null;
    }

}
